package com.mycompany.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	private static SessionFactory sessionFactory = createSessionFactory();
	
	private static SessionFactory createSessionFactory()
	{
		return new Configuration().configure().buildSessionFactory();
	}
	
	public static SessionFactory getSessionFactory()
	{
		return sessionFactory;
	}
	
	public static Session getCurrentSession()
	{
		return sessionFactory.getCurrentSession();
	}
	

}
